package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.SalemanMapper;
import com.gxa.saas.pojo.Saleman;
import com.gxa.saas.service.SalemanService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Throwable.class)
public class SalemanServiceImpl implements SalemanService {

    @Autowired
    SalemanMapper salemanMapper;

    @Override
    public List<Saleman> selectAll() {
       return   salemanMapper.selectAll();

    }

    @Override
    public List<Saleman> selectByPage(Integer page, Integer size) {
      //  System.out.println(page);
      //  System.out.println(size);
       return  salemanMapper.selectByPage(size*(page-1),size);

    }

    @Override
    public List<Saleman> selectByTime(String time) {
        return salemanMapper.selectByTime(time);
    }
}
